<%= header %>
<script src="03-xhrs-overlapping.js" type="text/javascript"></script>
<%= boomerangScript %>
<script>
BOOMR_test.init({
	"instrument_xhr": true,
	testAfterOnBeacon: BOOMR.plugins.AutoXHR ? 3 : 1,
	AutoXHR: {
		alwaysSendXhr: true
	},
	afterFirstBeacon:
		function() {
			if (!BOOMR.plugins.AutoXHR) {
				return;
			}

			setTimeout(function() {
				// on completion, send two quick XHRs
				var xhr1 = new XMLHttpRequest();
				xhr1.open("GET", "/delay?delay=10000&file=build/boomerang-latest-debug.js?1");

				// start sending the first
				xhr1.send(null);

				// wait 3 seconds to start the second one
				setTimeout(function() {
					var xhr2 = new XMLHttpRequest();
					xhr2.open("GET", "/delay?delay=10000&file=build/boomerang-latest-debug.js?2");

					// send the second one
					xhr2.send(null);

					// abort both immediately
					xhr1.abort();
					xhr2.abort();
				}, 3000);
			}, 100);
		}
});
</script>
<%= footer %>
